<template>
  <div class="hdbox">
    <!-- <head-nav></head-nav> -->
    <div class="hd-t">活动简介</div>
    <div class="hd-list">{{resobj.HDJS}}</div>
    <div class="hd-t">报名开始时间</div>
    <div class="hd-list">{{resobj.BMKSSJ}}</div>
    <div class="hd-t">报名结束时间</div>
    <div class="hd-list">{{resobj.BMJSSJ}}</div>
    <div class="hd-t">报名须知</div>
    <div class="hd-list">{{resobj.BMXZ}}</div>
    <div class="hd-t">投票须知</div>
    <div class="hd-list">{{resobj.TPXZ}}</div>
  </div>
</template>

<script>
import api from "@/api/api";
import { Toast } from "mint-ui";
export default {
  // props:['resobj'],
  data() {
    return {
      resobj: {},
      userid:'',
    };
  },
  methods: {
    //全局设置数据请求
    getqjset(that, userid) {
      api.getActiveIndex(that, userid, function(res) {
        let data = res.data;
        console.log(data, "晒照片全局设置");
        if (data.code == 0) {
          that.resobj = data.data;
        } else {
          that.Toastfn(data.msg, 2000, "");
        }
      });
    },
    // 提示函数
    Toastfn(message, duration, position) {
      Toast({
        message: message,
        duration: duration,
        position: position
      });
    }
  },
  mounted() {
    let that = this;
    var userinfo = JSON.parse(sessionStorage.getItem("userinfo"));
    if (userinfo && userinfo.vipcode) {
      let userid = userinfo.vipcode;
      this.userid = userid;
    } else {
      Toast({
        message: "您还不是会员，快去注册吧！",
        duration: 1600
      });
      setTimeout(function() {
        that.$router.push({ path: "/register", query: { type: "sign" } });
      }, 1600);
      return false;
    }
    localStorage.setItem("footnavselected", 2);
    this.$emit("footnavzt", true); //显示底部导航
    this.getqjset(that, this.userid); //获取全局设置信息
  }
};
</script>

<style scoped lang="less">
.hdbox {
  background-color: #ffffff;
  margin: 0.2rem;
  overflow: hidden;
  margin-bottom: 70px;
  .hd-t {
    padding: 0.15rem 0.2rem;
    background-color: #f1f1f1;
    font-size: 0.32rem;
    color: #333333;
  }
  .hd-list {
    color: #666666;
    padding: 0.3rem 0.2rem;
    font-size: 14px;
  }
}
</style>
